<h1>Listing links</h1>

<table>
  <tr>
    <th>Url</th>
  </tr>

<% for link in @links %>
  <tr>
      <td><%= link_to image_tag("VoteUp.jpg"), :action => :vote_up, :id => link %></td>
      <td><%= link_to image_tag("VoteDown.jpg"), :action => :vote_down, :id => link %></td>
      <td><%= link_to link.url, link.url, :popup => true %></td>
      <td><%= button_to "remove", :action => :remove, :id => link %></td>
  </tr>
<% end %>
</table>

<br />

<% form_for(@link) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :url %><br />
    <%= f.text_field :url %>
  </p>
  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>

